{if $GLOBALS.is_ajax}
	<link type="text/css" href="{$GLOBALS.user_site_url}/system/ext/jquery/css/jquery-ui.css" rel="stylesheet" />
	<link type="text/css" href="{$GLOBALS.user_site_url}/system/ext/jquery/themes/green/jquery-ui-1.7.2.custom.css" rel="stylesheet" />
	    
	<script language="JavaScript" type="text/javascript" src="{$GLOBALS.user_site_url}/system/ext/jquery/jquery.js"></script>
	<script language="JavaScript" type="text/javascript" src="{$GLOBALS.user_site_url}/system/ext/jquery/jquery-ui.js"></script>
	<script language="JavaScript" type="text/javascript" src="{$GLOBALS.user_site_url}/system/ext/jquery/jquery.form.js"></script>
	<script language="JavaScript" type="text/javascript" src="{$GLOBALS.user_site_url}/system/ext/jquery/jquery.bgiframe.js"></script>
	<script language="javascript">
	
	var url = "{$GLOBALS.site_url}/edit-user/";
	
	{literal}
		$("#editUserForm").submit(function() {
			var options = {
				target: "#messageBox",
	            url:  url,
	            succes: function(data) {
					$("#messageBox").html(data).dialog({width: 200});
				}
	        };
	        $(this).ajaxSubmit(options);
	        return false;
		});
	{/literal}
	</script>
{/if}

{breadcrumbs}<a href="{$GLOBALS.site_url}/users/?restore=1">Users</a> &#187; Edit User Info{/breadcrumbs}
<h1><img src="{image}/icons/users32.png" border="0" alt="" class="titleicon"/> Edit User Info</h1>

<p>
    <a href="{$GLOBALS.site_url}/system/applications/view/?user_sid={$user_info.sid}" class="grayButton">Manage Applications</a>
    <a href="{$GLOBALS.site_url}/user-products/?user_sid={$user_info.sid}" class="grayButton">Manage User Products</a>
    <a href="{$GLOBALS.site_url}/private-messages/pm-main/?user_sid={$user_info.sid}" class="grayButton">Manage Personal messages</a>
    <a href="{$GLOBALS.site_url}/system/users/acl/?type=user&amp;role={$user_info.sid}" class="grayButton">View Permissions</a>
    <a href="{$GLOBALS.site_url}/email-log/?user_sid={$user_info.sid}" class="grayButton">View Email Log</a>
</p>
{include file='field_errors.tpl'}
<br/>
<fieldset>
	<legend>User Info</legend>
	<form method="post" enctype="multipart/form-data" id="editUserForm">
		{set_token_field}
		<input type="hidden" id="action_name" name="action_name" value="save_info" />
		<table>
            {if $parent_name}
                <tr>
                    <td>
                        Sub-user of <a href="{$GLOBALS.site_url}/edit-user/?user_sid={$user_info.parent_sid}" title="Edit"">{$parent_name}</a>
                    </td>
                </tr>
            {/if}
			{foreach from=$form_fields item=form_field}
			{if $form_field.id == "video"}
				<tr>
					<td valign="top">{$form_field.caption}</td>
					<td valign="top">{if $form_field.is_required} <font color="red">*</font>{/if}</td>
					<td >{input property=$form_field.id template="video_profile.tpl"}</td>
				</tr>
			{else}
				<tr>
					<td valign="top">{$form_field.caption}</td>
					<td valign="top">{if $form_field.is_required} <font color="red">*</font>{/if}</td>
					<td>{input property=$form_field.id}</td>
				</tr>
			{/if}
			{/foreach}
			<tr>
				<td colspan="3">
                    <div class="floatRight">
                        <input type="hidden" name="user_sid" value="{$user_info.sid}" />
                        <input type="submit" id="apply" value="Apply" class="grayButton" />
                        <input type="submit" value="Save" class="grayButton" />
                    </div>
				</td>
			</tr>
		</table>
	</form>
</fieldset>

{literal}
	<script>
        $('#apply').click(
            function() {
                $('#action_name').attr('value', 'apply_info');
            }
        );
    </script>
{/literal}